﻿using System.Data.SqlClient;

namespace dPet.Infrastructure.EntityFramework.Repositories
{
	using dPet.Domain.Models;
	using dPet.Domain.Repositories;
	using Hangerd.EntityFramework;
	using Hangerd.Repository;

	public class ServiceItemSKURepository : EfRepository<ServiceItemSKU>, IServiceItemSKURepository
	{
		public ServiceItemSKURepository(IRepositoryContext unitOfWork)
			: base(unitOfWork)
		{ }

		public void RemoveAllByServiceItem(ServiceItem serviceItem)
		{
			base.ExecuteCommand("DELETE dbo.ServiceItemSKU WHERE ServiceItem_Id = @serviceItemId",
				new SqlParameter("@serviceItemId", serviceItem.Id));
		}
	}
}
